package ch.sfug.util {

	/**
	 * @author mich
	 */
	public class ArrayShuffle {

		public static function shuffle( a:Array ):Array {
			var na:Array = new Array();
			var oa:Array = a.slice();
			while( oa.length > 0 ) {
				na.push( oa.splice( Math.floor( Math.random() * oa.length ), 1 )[0] );
			}
			return na;
		}
	}
}
